<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript">

    function validate() {
        var pls_enter_name = "Please Enter name";
        var pls_enter_objection = "Please Enter Objection";
        $("#add-objection").validate({
            rules:{

                nameId:{
                    required: true
                },
                ObjectionId:{
                    required: true
                } ,
                emailId: {
                    email:true
                }
            },
            messages:{
                nameId:{
                    required: "<br/>" + pls_enter_name
                },
                nameId:{
                    ObjectionId: "<br/>" + pls_enter_objection
                }
            }
        });
    }

</script>


<div class="page-title">
    <h2><s:label value="%{getText('addObjectionByslc.label')}"/></h2>
</div>

<div id="search-lands-form-outer">
    <fieldset>
    <s:form method="POST" id="add-objection" name="add-objection" enctype="multipart/form-data"
            onsubmit="javascript:return validateFormForInputDataSyntaxErrors('add-objection')">
        <table>

            <tr>
                <td>
                    <s:label value="Date"/>
                    <s:label value="%{getText('date_format.label')}" cssClass="date-format"/></td>
                <td colspan="3"><s:textfield id="endingDate"
                                             name=""
                                             onKeyPress="return dateNumbersOnly(event,true)"/></td>
            </tr>

            <tr>
                <td><s:label value="Name"/><span class="mandatory-field"></span></td>
                <td colspan="3"><s:textfield id="nameId"
                                             name="objection.person.name"
                        /></td>
            </tr>

            <tr>
                <td><s:label value="NIC"/></td>
                <td colspan="3"><s:textfield id="nicId" name="objection.person.personNIC"
                        /></td>
            </tr>


            <tr>
                <td><s:label value="E-mail"/></td>
                <td colspan="3"><s:textfield id="emailId"
                                             name="objection.person.contacts.email"
                        /></td>
            </tr>

            <tr>
                <td><s:label value="Objection"/><span class="mandatory-field"></span></td>
                <td colspan="3"><s:textarea id="ObjectionId"
                                            name="objection.objection"
                                            cssClass="width-400-px" rows="6"/></td>
            </tr>

            <tr>
                <td colspan="2">
                    <s:submit value="%{getText('save.label')}" action="addSlcObjection" onclick="validate()"/>
                    <s:submit value="%{getText('cancel.label')}" action="shortListedCandidates"/>
                    <s:hidden name="landApplication.id"/>

                </td>
            </tr>
        </table>
        <s:hidden name="applicationId"/>
    </s:form>
        </fieldset>
</div>

